<template>
  <div class="mb22">
    <Title title="评分信息" style="margin:0px 0 10px 0;"/>
    <el-table
      :data="tableData"
      style="width: 100%">
      <EmptyPlaceholder slot="empty" is-border mode="table" style="padding-bottom: 0;" />
      <el-table-column label="初筛结果" width="180">
        <template slot-scope="scope">
          <StatusText :color="['#406eff','#FD8546', '#31CC9C', '#FF4E5F', '#31CC9C', '#FF4E5F'][getColor(scope.row.result)]" :text="scope.row.result" />
        </template>
      </el-table-column>
      <el-table-column label="综合得分" width="180">
        <template slot-scope="scope">
          <ToolTip :content="scope.row.score" />
        </template>
      </el-table-column>
      <el-table-column label="商务评分人员" width="180">
        <template slot-scope="scope">
          <CheckUserInfo :user-id="scope.row.businessPersonId" :label="scope.row.businessPerson" style="margin-right: 4px;" />
        </template>
      </el-table-column>
      <el-table-column label="商务评分" width="180">
        <template slot-scope="scope">
          <ToolTip :content="scope.row.businessScore" />
        </template>
      </el-table-column>
      <el-table-column label="商务评分理由" width="180">
        <template slot-scope="scope">
          <ToolTip :content="scope.row.businessReason" />
        </template>
      </el-table-column>
      <!-- 取消媒介评分 -->
      <!-- <el-table-column label="媒介评分人员" width="180">
        <template slot-scope="scope">
          <CheckUserInfo :user-id="scope.row.mediumPersonId" :label="scope.row.mediumPerson" style="margin-right: 4px;" />
        </template>
      </el-table-column>
      <el-table-column label="媒介评分" width="180">
        <template slot-scope="scope">
          <ToolTip :content="scope.row.mediumScore" />
        </template>
      </el-table-column>
      <el-table-column label="媒介评分理由" width="180">
        <template slot-scope="scope">
          <ToolTip :content="scope.row.mediumReason" />
        </template>
      </el-table-column> -->
      <el-table-column label="评分完成时间" width="180">
        <template slot-scope="scope">
          <ToolTip :content="format(scope.row.completionTime / 1000, 'YYYY/MM/DD HH:mm:ss')" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import EmptyPlaceholder from '@/components/Common/emptyPlaceholder';
import Title from '@/components/Title';
import { format } from '@/filters/date';
import { formatResult } from '@/filters/status';

export default {
  components: { Title, EmptyPlaceholder },
  filters: { formatResult },
  props: {
    tableData: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  methods: {
    format,
    getColor(result) {
      return {
        '待提交': 0,
        '评分中': 1,
        '合格': 2,
        '不合格': 3,
        '合格(特批)': 4,
        '不合格(特批)': 5
      }[result];
    }
  }
};
</script>

<style lang="scss" scoped>
.mb22 {
  margin-bottom: 22px;
}
</style>
